home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / bread-cooking.swf / scripts / frame_84 / PlaceObject2_31_4 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-01-13  |  522b  |  28 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.isGameOver)
  3.    {
  4.       return undefined;
  5.    }
  6.    nt = getTimer() - startTime;
  7.    tm = 1000 * _root.TIME_MAX - nt;
  8.    if(tm < 0)
  9.    {
  10.       tm = 0;
  11.    }
  12.    if(prevTime != tm)
  13.    {
  14.       prevTime = tm;
  15.       k3 = String(parseInt(tm / 60000) % 60);
  16.       k2 = String(parseInt(tm / 1000) % 60);
  17.       if(k2.length == 1)
  18.       {
  19.          k2 = "0" + k2;
  20.       }
  21.       f_Time = k3 + ":" + k2;
  22.       if(tm == 0)
  23.       {
  24.          _root.gameOver(true);
  25.       }
  26.    }
  27. }
  28.